<div class="detail-box statistics-box layui-form">



    <div class="layui-form">
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col>
                <col>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>设备数目</th>
                <th>正常</th>
                <th>维修</th>
                <th>报废</th>
            </tr>
            </thead>
            <tbody>

            <tr>
                <td><? echo  count_by_item($table_Prefix."equipment","status != '报废'");?></td>
                <td><? echo  count_by_item($table_Prefix."equipment","status = '正常'");?></td>
                <td><? echo  count_by_item($table_Prefix."equipment","status = '维修'");?></td>
                <td><? echo  count_by_item($table_Prefix."equipment","status = '报废'");?></td>

            </tr>


            </tbody>
        </table>
    </div>







    <h2>统计信息</h2>
    <div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="80">
            <col width="200">
            <col >
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>项目</th>
            <th>统计</th>
            <th>金额</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>1</td>
            <td>维修记录</td>
            <td><?echo count_by_item($table_Prefix."repair","")?> 次</td>
            <td><?echo sum_total($table_Prefix."repair","cost","")?> 元</td>
        </tr>

        </tbody>
    </table>
    </div>






    <h2>最近12月统计</h2>
    <div class="layui-form">
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col>
                <col>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>项目</th>
                <? for($i=0;$i<12;$i++){?>
            <th>
                 <?echo date("Y-m",strtotime("-$i month"))?>
            </th> <?}?>
            </thead>
            <tbody>


                <tr>
                    <td>维修次数</td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-0 month"))."%'")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-1 month"))."%'")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-2 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-3 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-4 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-5 month"))."%'")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-6 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-7 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-8 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-9 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-10 month"))."%'  ")?></td>
<td><? echo count_by_item($table_Prefix."repair","repairdate like '".date("Y-m",strtotime("-11 month"))."%'  ")?></td>

                </tr>
<tr>
                    <td>维修金额</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-0 month"))."%' ")?> 元</td>

<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-1 month"))."%' ")?> 元</td>


<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-2 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-3 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-4 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-5 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-6 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-7 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-8 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-9 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-10 month"))."%' ")?> 元</td>
<td><?echo sum_total($table_Prefix."repair","cost","repairdate like '".date("Y-m",strtotime("-11 month"))."%' ")?> 元</td>

                </tr>


            </tbody>
        </table>
    </div>







</div>